<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
        <script src="js/time.js?"></script>
        <script charset="utf-8" src="edit/kindeditor.js"></script>
		<script charset="utf-8" src="edit/lang/zh_CN.js"></script>
		<script charset="utf-8" src="edit/plugins/code/prettify.js"></script>
		<script>
		KindEditor.ready(function(K) {
                var editor1 = K.create('textarea[id="contents"]', {
                    //width : w,
                    cssPath: 'edit/plugins/code/prettify.css',
                    uploadJson: 'edit/php/upload_json.php',
                    fileManagerJson: 'edit/php/file_manager_json.php',
                    allowFileManager: true,
                    urlType: "domain",
                    afterCreate: function() {
                        var self = this;
                        K.ctrl(document, 13, function() {
                            self.sync();
                            K('form[name=rowForm]')[0].submit();
                        });
                        K.ctrl(self.edit.doc, 13, function() {
                            self.sync();
                            K('form[name=rowForm]')[0].submit();
                        });
                    }
                });
                prettyPrint();
            });
		</script>
    </head>
    <body >
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <?php 
        //print_r($row); 
        //print_r($modStrategyList[$row['tableenum']]);
        ?>
        <form action="" method="POST" id="rowForm">
            <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid tableedit">
            
            	<tr><td><?= translate('ACTIVITY_GROUPAREA_AREAID') ?>:</td><td>&nbsp;
            	<?=$row['areaid'] ?></td></tr>
            	
            	<tr><td><?= translate('ACTIVITY_GROUPAREA_AREAANME') ?>:</td><td>&nbsp;
            	<?=$row['areaname'] ?></td></tr>
            	
            	<tr><td><?= translate('ACTIVITY_MODULE_MODULENAME') ?>:</td><td>&nbsp;
            	<?=$row['tabledes'] ?></td></tr>
            	
            	<tr><td><?= translate('ACTIVITY_GROUPSTATEGY_DES') ?>:</td><td>&nbsp;
            	<!--  <input type="text" name="row[des]" id = "tabledes" value="<?=$row['des'] ?>"/> -->
            	<textarea cols="70" rows="13" name="row[des]" id="contents"><?=$row['des'] ?></textarea>
            	</td></tr>
            	
            	<tr><td><?= translate('ACTIVITY_GROUPSTATEGY_STRATEGYID') ?>:</td>
                  <td>
                  
                  <select name="row[strategyid]">
                  	<?php foreach ($modStrategyList[$row['tableenum']] as $key=>$value) { ?>
                    <option value="<?=$key ?>" <?php if($key==$row['strategyid']) echo 'selected'; ?> ><?=$value ?></option>
                    <?php } ?>
                  </select>

                  </td>
                </tr>      
                
                <tr><td><?= translate('STARTTIME') ?>:</td><td>
                	<input type="text" name="row[starttime]" id="starttime" size="25" 
                	value="<?=date('Y-m-d H:i:s', $row['starttime']) ?>" 
                	onClick="SelectDate(this,'yyyy-MM-dd hh:mm:ss',0,10)"/>
                </td></tr>
                <tr><td><?= translate('ENDTIME') ?>:</td><td>
                	<input type="text" name="row[endtime]" id="endtime" size="25" 
                	value="<?=date('Y-m-d H:i:s', $row['endtime']) ?>"
                	onClick="SelectDate(this,'yyyy-MM-dd hh:mm:ss',0,10)"/>
                </td></tr>
                
                <!-- 隐式传一个值过去 -->
                <input type="hidden" name="row[tableenum]" id = "tableenum" value="<?=$row['tableenum'] ?>"/>
                <input type="hidden" name="row[areaid]" id = "areaid" value="<?=$row['areaid'] ?>"/>
                
                <tr><td>&nbsp;</td>
                <td><input type="submit" value="<?= translate('SUBMIT') ?>" id="submit"/> 
                <input type="reset" value="<?= translate('RESET') ?>" id="reset"/></td></tr>
            </table>
        </form>
        <script type="text/javascript">
            SG.init("core.form", function() {
                $.formValidator.initConfig({formid: "#rowForm", submitonce: true});
                $("#starttime").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: "^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s((([0-1][0-9])|(2?[0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$", onerror: '<?= translate('C_INVALID_TIME') ?>'});
                $("#endtime").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: "^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s((([0-1][0-9])|(2?[0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$", onerror: '<?= translate('C_INVALID_TIME') ?>'});
                $("#tabledes").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#stategyid").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                });
        </script>
    </body>
</html>